package com.estock.common.model.task.enums;


public enum TaskStatus {
	ACTIVE(1, "Active"), DISABLED(2, "Disabled");
	
	private int status;
	private String desc;
	
	TaskStatus(int status, String desc) {
		this.status = status;
		this.desc = desc;
	}
	
	public int getStatus() {
		return this.status;
	}
	
	public String getDesc() {
		return desc;
	}

	public static String getDescByStatus(int status) {
		if (TaskStatus.ACTIVE.status == status) {
			return TaskStatus.ACTIVE.desc;
		} else if (TaskStatus.DISABLED.status == status) {
			return TaskStatus.DISABLED.desc;
		}
		throw new RuntimeException("Unsupported task status.");
	}
	
}
